import java.util.ArrayList;

/**
 * Created by WEN on 2016/9/28.
 */
public class SingleNumberlll {
    public int[] singleNumber(int[] nums) {
        ArrayList<Integer> list = new ArrayList<Integer>();
        int index;
        for(Integer a:nums){
            index = list.indexOf(a);
            if (index!=-1){
                list.remove(index);
            }else list.add(a);
        }
        nums = new int[list.size()];
        nums[0] = list.get(0);
        nums[1] = list.get(1);
        return nums;
    }
}
